<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
	<title>K19 - Treinamentos</title>
</h:head>
<h:body>
	<h:form>
		<h:panelGrid columns="2">
			<h:outputLabel value="Valor: " for="valor" />
			<h:inputText value="#{conversorMonetarioBean.valor}" id="valor" />

			<h:outputLabel value="De: " for="de" />
			<h:selectOneMenu value="#{conversorMonetarioBean.de}" id="de">
				<f:selectItems value="#{conversorMonetarioBean.taxas.keySet()}" var="moeda" itemLabel="#{moeda}" itemValue="#{moeda}" />
			</h:selectOneMenu>

			<h:outputLabel value="Para: " for="para" />
			<h:selectOneMenu value="#{conversorMonetarioBean.para}" id="para">
				<f:selectItems value="#{conversorMonetarioBean.taxas.keySet()}" var="moeda" itemLabel="#{moeda}" itemValue="#{moeda}" />
			</h:selectOneMenu>

		<h:commandButton action="#{conversorMonetarioBean.converte()}" value="Converter" />
				</h:panelGrid>
	</h:form>

	<br />

	<h:outputFormat value="{0} em {1} equivale a {2} em {3}" rendered="#{conversorMonetarioBean.resultado != null}">
		<f:param value="#{conversorMonetarioBean.valor}" />
		<f:param value="#{conversorMonetarioBean.de}" />
		<f:param value="#{conversorMonetarioBean.resultado}" />
		<f:param value="#{conversorMonetarioBean.para}" />
	</h:outputFormat>

</h:body>
</html>
